<?php
/*
	
*/
defined('BY_JYA') or exit('Access Denied');
global $_RQ,$_AR;
$_RQ['op']=$_RQ['op']?$_RQ['op']:'detail';
$return['basic']=$this->plugin_setting('basic');
if($_RQ['op']=='detail'){
	set_html('title','蓝牙配网');
	$return['post']=array();
	$return['item']=$item;
	exi($return);
}
if($_RQ['op']=='getapi'){
	$postdata=get_postdata();
	if(!$postdata['sz_type']){
		$this->model('sheyu')->getti($postdata,'TongueFaceAnalysis');
	}elseif($postdata['sz_type']==1){
		$this->model('sheyu')->getti2($postdata);
	}
	exi('success');
}
if($_RQ['op']=='wifiend'){
	$postdata=get_postdata();
	$isgoods=pdo_get('jy_aiagent_goodslog',array('macsn'=>$postdata['deviceId'],'mid'=>$_SESSION['uid'],'uniacid'=>$_SESSION['uniacid']));
	if($isgoods['id']){
	}else{
		$agent=$this->model('agent')->addgoodsagent();
		$data=array(
			'agentid'=>$agent['id'],
			'agentapiid'=>$agent['apiid'],
			'status'=>1,
		);
		$data['macsn']=trim($postdata['deviceId']);
		$data['title']=trim($postdata['devicename']);
		$data['uniacid']=$_SESSION['uniacid'];
		$data['mid']=$_SESSION['uid'];
		$data['createtime']=TIMESTAMP;
		pdo_insert('jy_aiagent_goodslog',$data);
	}
	exi('success');
}